<?php
/**
 * Description tab
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */

global $woocommerce, $post, $docsku;

	$docsku = get_post_custom($post->ID);
	$documentsku = $docsku['_sku'];
	foreach ( $documentsku as $printsku );

?>

		<h2>Product Documents &amp; Resources</h2>

<ul>
	<li><a href="http://www.siliconsolar.com/publication/silicon-solar-company-brochure/wppa_open">Silicon Solar Company Information Brochure</a></li>
	<li><a href="http://www.siliconsolar.com/publication/sunmaxx-company-information-brochure/wppa_open">SunMaxx Company Information Brochure</a></li>
	<li><a href="http://techvideos.siliconsolar.com" target="_blank">Solar How-To &amp; Troubleshooting Videos</a></li>
    <li><a href="http://www.solarwebinars.com" target="_blank">Interested In Solar Hot Water? Check Out Our Solar Hot Water Training Videos</a></li>
</ul>

		<?php

	echo '<h4>Product Documents</h4>';
    echo '<ul>';

	echo '<span style="display:none;">';
		$skutag = $printsku;
	echo '</span>';

	$brochure_query = new WP_Query('tag=' .$skutag . '&showposts=1&post_type=publication&category-name=solar-product-brochures');
	while ($brochure_query->have_posts()) :
	$brochure_query->the_post(); ?>
			<li><a href="<?php the_permalink(); ?>">Product Brochure</a></li>
		<?php endwhile ; ?>
        
    <?php $datasheet_query = new WP_Query('tag=' .$skutag . '&showposts=1&post_type=publication&category-name=solar-product-datasheets');
	while ($datasheet_query->have_posts()) :
	$datasheet_query->the_post(); ?>
			<li><a href="<?php the_permalink(); ?>">Product Datasheet</a></li>
		<?php endwhile ; ?>
	
	<?php $install_query = new WP_Query('tag=' .$skutag . '&showposts=1&post_type=publication&category-name=solar-product-installation-manual');
	while ($install_query->have_posts()) :
	$install_query->the_post(); ?>
			<li><a href="<?php the_permalink(); ?>">Product Install Manual</a></li>
		<?php endwhile ; ?>
        
    <?php $certification_query = new WP_Query('tag=' .$skutag . '&showposts=1&post_type=publication&category-name=solar-srcc-certifications');
	while ($certification_query->have_posts()) :
	$certification_query->the_post(); ?>
			<li><a href="<?php the_permalink(); ?>">Product SRCC Certification</a></li>
		<?php endwhile ; ?>

<?php
	echo '</ul>';
?>
